home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / Digital Sound Studio v1.0.adf / DSS / Player.asm < prev    next >
Assembly Source File  |  1991-08-26  |  18KB  |  648 lines

  1. ;**************************************************************************
  2. ;*
  3. ;*   DSS MODULE PLAY ROUTINE
  4. ;*   -----------------------
  5. ;*
  6. ;*   If you wish to use some DSS Tracker Modules into your own programs,
  7. ;*   you can read the following listing...
  8. ;*
  9. ;*   This file contains the needed functions for playing a DSS Module.
  10. ;*   You have to allocate, to load  and to free the memory (CHIP) yourself.
  11. ;*
  12. ;*  >Once the Module is loaded in CHIP memory:
  13. ;*
  14. ;*   -Set the [ SongPointer ] pointer (at the end of this file) with the
  15. ;*    Module's address.
  16. ;*   -Call the [ InitPlay() ] function.
  17. ;*
  18. ;*  >To stop the Module, you just have to call the [ RemovePlayer() ]
  19. ;*   function.
  20. ;*
  21. ;*   This program has been writen for the Aztec C 3.6 assembler.
  22. ;*   It can be easily adapted to another assembler.
  23. ;*
  24. ;**************************************************************************
  25.  
  26. ;----- Amiga function ------
  27.  
  28. _LVOOpenResource        EQU        -498
  29. _LVOAddICRVector        EQU        -6
  30. _LVORemICRVector        EQU        -12
  31.  
  32. ;------- ExecBase ----
  33.  
  34. SysBase                 EQU     4
  35. PAL                     EQU     50
  36. eb_PowerSupplyFreq      EQU     531
  37.  
  38. ;------- CIAA --------
  39.  
  40. CIAAPRA         EQU     $bfe001
  41. CIABTALO        EQU     $bfd400
  42. CIABTAHI        EQU     $bfd500
  43. CIABICR         EQU     $bfdd00
  44. CIABCRA         EQU     $bfde00
  45.  
  46. CIABTBLO        EQU     $bfd600
  47. CIABTBHI        EQU     $bfd700
  48. CIABCRB         EQU     $bfdf00
  49.  
  50. ;------ Song ----------
  51.  
  52. sng_Tempo       EQU     8
  53. sng_Instr0      EQU     10
  54. sng_Len         EQU     1436
  55. sng_Seq         EQU     1438
  56. sng_Data        EQU     1566
  57.  
  58. ;------ InstrData -----
  59.  
  60. MAXINSTR        EQU     30
  61. SIZEOF_insdt    EQU     46
  62.  
  63. instr_Name      EQU     0
  64. instr_Start     EQU     30
  65. instr_Len       EQU     34
  66. instr_RStart    EQU     36
  67. instr_RLen      EQU     40
  68. instr_Vol       EQU     42
  69. instr_Freq      EQU     44
  70.  
  71. ;------- AudioData -
  72.  
  73. SIZEOF_ad       EQU     24
  74.  
  75. ad_SampPer      EQU     0
  76. ad_Effet        EQU     2
  77. ad_Info         EQU     3
  78. ad_Volume       EQU     4
  79. ad_SmpAdr       EQU     6
  80. ad_SmpLen       EQU     10
  81. ad_RepAdr       EQU     12
  82. ad_RepLen       EQU     16
  83. ad_ArpPer       EQU     18
  84. ad_DMABit       EQU     20
  85. ad_PitchPer     EQU     22
  86.  
  87. ;------- AudioChips -------
  88.  
  89. DMACON          EQU     $dff096
  90. DMASET          EQU     $8000
  91.  
  92. AUD0LCH         EQU     $dff0a0
  93. AUD1LCH         EQU     $dff0b0
  94. AUD2LCH         EQU     $dff0c0
  95. AUD3LCH         EQU     $dff0d0
  96. AUDxLEN         EQU     $4
  97. AUDxPER         EQU     $6
  98. AUDxVOL         EQU     $8
  99. AUDxDAT         EQU     $a
  100. SIZEOF_AUD      EQU     $10
  101.  
  102. ;------ Block ---------
  103.  
  104. NEXTTRACK       EQU     4
  105. NEXTLINE        EQU     16
  106. BLOCKSIZE       EQU     1024
  107. MAXTRACK        EQU     4
  108.  
  109. ;------- Notes -------
  110.  
  111. DO2             EQU     1712
  112. SI5             EQU     113
  113. STOP            EQU     $7ff
  114.  
  115. ;------- Effects -----
  116.  
  117. MASK_EFF        EQU     7
  118. MASK_VAL        EQU     $f
  119.  
  120. ARPEGGIO        EQU     0
  121. PITCHUP         EQU     1
  122. PITCHDOWN       EQU     2
  123. VOLUME          EQU     3
  124. MASTERVOL       EQU     4
  125. TEMPO           EQU     5
  126. JUMP            EQU     6
  127. FILTER          EQU     7
  128.  
  129. MAX_VOL         EQU     64
  130. BREAK           EQU     $ff
  131.  
  132.  
  133.         CSEG
  134.  
  135. ;------------------ functions to call -----------------
  136.  
  137. ; Timer interruption installation and Player initialization routines
  138. ; Return 0 (zero) if successful.
  139. ; Return 1 if the installation is not possible.
  140.  
  141. InitPlay:
  142.         movem.l d1-d2/a0-a3/a6,-(sp)
  143.         move.l  SysBase,a6
  144.         lea     CiabName,a1
  145.         moveq   #0,d0
  146.         jsr     _LVOOpenResource(a6)
  147.         move.l  d0,CiabBase
  148.         beq.s   InitPlayError
  149.         cmp.b   #PAL,eb_PowerSupplyFreq(a6)
  150.         beq.s   initsong
  151.         move.w  #2,IsNTSC
  152. initsong:
  153.         bsr.s   InitSampleAdr
  154.         bsr.s   InitSamples
  155.         bsr.s   InitInterrupt
  156.         tst.l   d0
  157.         beq.s   EndInitPlay
  158. InitPlayError:
  159.         moveq   #1,d0
  160. EndInitPlay:
  161.         movem.l (sp)+,d1-d2/a0-a3/a6
  162.         rts
  163.  
  164. ; Stop to play the module
  165.  
  166. RemovePlayer:
  167.         movem.l d0-d1/a0-a1/a6,-(sp)
  168.         bsr.s   DisablePlayer
  169.         move.l  CiabBase,a6
  170.         lea     TimerInt,a1
  171.         moveq   #1,d0
  172.         jsr     _LVORemICRVector(a6)
  173.         bclr    #1,CIAAPRA
  174.         movem.l (sp)+,d0-d1/a0-a1/a6
  175.         rts
  176.  
  177. ;-------------- internal functions -----------------
  178.  
  179. InitInterrupt:
  180.         bsr.s   EnablePlayer
  181.         move.l  CiabBase,a6
  182.         lea     TimerInt,a1
  183.         moveq   #1,d0
  184.         jsr     _LVOAddICRVector(a6)
  185.         tst.l   d0
  186.         bne.s   InitInterruptEnd
  187.         move.b  CIABCRB,d0
  188.         and.b   #%10000000,d0
  189.         or.b    #1,d0
  190.         move.b  d0,CIABCRB
  191.         move.b  #$82,CIABICR
  192.         lea     TimerTable,a0
  193.         move.w  IsNTSC,d0
  194.         move.b  1(a0,d0),CIABTBLO
  195.         move.b  (a0,d0),CIABTBHI
  196.         moveq   #0,d0
  197. InitInterruptEnd:
  198.         rts
  199.  
  200. InitSampleAdr:
  201.         move.l  SongPointer,a1
  202.         lea     sng_Len(a1),a0
  203.         move.w  (a0)+,d0                ; d0 = songlen
  204.         subq.w  #1,d0
  205.         moveq   #0,d1
  206.         move.l  d1,d2
  207. SeekLastBlockLoop:
  208.         move.b  (a0)+,d2
  209.         cmp.b   d2,d1
  210.         bhi.s   NotLastBlock
  211.         move.b  d2,d1
  212. NotLastBlock:
  213.         dbra    d0,SeekLastBlockLoop
  214.         addq.w  #1,d1
  215.         moveq   #10,d0
  216.         lsl.l   d0,d1                   ; d1 = block size
  217.         lea     sng_Data(a1),a0
  218.         add.l   d1,a0                   ; a0 -> first sample
  219.         lea     sng_Instr0(a1),a2       ; a2 -> first instrument
  220.         lea     SampleAdrTable,a3
  221.         moveq   #MAXINSTR,d0
  222. InitAdrLoop:
  223.         moveq   #0,d1
  224.         move.w  instr_Len(a2),d1        ; len ?
  225.         beq.s   InitNextAdr
  226. InitThisAdr:
  227.         move.l  a0,(a3)
  228.         moveq   #0,d2
  229.         cmp.w   #1,instr_RLen(a2)       ; rlen
  230.         beq.s   GetSampleSize
  231.         move.w  instr_RLen(a2),d2
  232.         add.l   d2,d1
  233. GetSampleSize:
  234.         add.l   d1,d1
  235.         bclr    #0,instr_Start+3(a2)    ; align instr_Start on a word
  236.         add.l   instr_Start(a2),d1      ; Start
  237.         add.l   d1,a0                   ; a0 -> nextsample
  238. InitNextAdr:
  239.         addq.l  #4,a3
  240.         add.l   #SIZEOF_insdt,a2
  241.         dbra    d0,InitAdrLoop
  242.         rts
  243.  
  244. InitSamples:
  245.         lea     SampleAdrTable,a0
  246.         moveq   #MAXINSTR,d0
  247. InitSamplesLoop:
  248.         move.l  (a0)+,d1
  249.         beq.s   InitSamplesLoopEnd
  250.         move.l  d1,a1
  251.         moveq   #3,d2
  252. Clear4Bytes:
  253.         clr.b   (a1)+
  254.         dbra    d2,Clear4Bytes
  255. InitSamplesLoopEnd:
  256.         dbra    d0,InitSamplesLoop
  257.         rts
  258.  
  259.  
  260. DisablePlayer:
  261.         clr.w   AUD0LCH+AUDxVOL
  262.         clr.w   AUD1LCH+AUDxVOL
  263.         clr.w   AUD2LCH+AUDxVOL
  264.         clr.w   AUD3LCH+AUDxVOL
  265.         move.w  #$0f,DMACON
  266.         rts
  267.  
  268. EnablePlayer:
  269.         clr.w   AUD0LCH+AUDxVOL
  270.         clr.w   AUD1LCH+AUDxVOL
  271.         clr.w   AUD2LCH+AUDxVOL
  272.         clr.w   AUD3LCH+AUDxVOL
  273.         rts
  274.  
  275. TimerIntRoutine:
  276.         movem.l d1-d7/a0-a6,-(sp)
  277.         bsr.s   PlayRoutine
  278.         movem.l (sp)+,d1-d7/a0-a6
  279.         moveq   #0,d0
  280.         rts
  281.  
  282. PlayRoutine:
  283.         move.l  SongPointer,a6
  284.         move.w  8(a6),d0
  285.         addq.w  #1,PlayTimer
  286.         cmp.w   PlayTimer,d0            ; tempo == playtimer ?
  287.         bne.s   PlayEffects             ; no, play effects
  288.         clr.w   PlayTimer               ; yes, reset timer to zero
  289.         bra.s   PlaySound               ; play note
  290.  
  291. PlayEffects:
  292.         lea     ChannelData0,a0
  293.         lea     AUD0LCH,a1
  294.         moveq   #MAXTRACK-1,d3          ; 4 tracks
  295. PlayEffLoop:
  296.         move.w  (a0),d0
  297.         and.w   #$7ff,d0
  298.         cmp.w   #STOP,d0                ; note == STOP ?
  299.         beq.s   PlayEffLoopEnd
  300.         tst.b   ad_Info(a0)             ; effect value == 0 ?
  301.         beq.s   PlayEffLoopEnd
  302.         bsr.s   MakeEffects
  303. PlayEffLoopEnd:
  304.         add.l   #SIZEOF_ad,a0           ; a0 -> next channeldata
  305.         add.w   #SIZEOF_AUD,a1          ; a1 -> next audio register
  306.         dbra    d3,PlayEffLoop
  307.         rts
  308.  
  309. MakeEffects:
  310.         move.b  ad_Effet(a0),d0
  311.         beq.s   EffArpeggio
  312.         cmp.b   #PITCHUP,d0
  313.         beq.s   EffPitchUp
  314.         cmp.b   #PITCHDOWN,d0
  315.         beq.s   EffPitchDown
  316.         rts
  317.  
  318. EffArpeggio:
  319.         moveq   #0,d0
  320.         move.w  PlayTimer,d0
  321.         cmp.w   #1,d0
  322.         beq.s   EffArpOne
  323.         cmp.w   #2,d0
  324.         beq.s   EffArpTwo
  325.         cmp.w   #3,d0
  326.         beq.s   EffArpThree
  327.         cmp.w   #4,d0
  328.         beq.s   EffArpTwo
  329.         cmp.w   #5,d0
  330.         beq.s   EffArpOne
  331.         rts
  332.  
  333. EffArpOne:
  334.         move.b  ad_Info(a0),d0
  335.         lsr.b   #4,d0                   ; d0 = high nibble value
  336.         bra.s   EffArpSeek
  337. EffArpTwo:
  338.         move.b  ad_Info(a0),d0
  339.         and.b   #MASK_VAL,d0            ; d0 = low nibble value
  340.         bra.s   EffArpSeek
  341. EffArpThree:
  342.         move.w  ad_ArpPer(a0),d2        ; d2 = normal period
  343.         bra.s   EffArpFound
  344. EffArpSeek:
  345.         add.w   d0,d0                   ; d0 = offset notetable
  346.         move.w  ad_ArpPer(a0),d1        ; d1 = normal period
  347.         lea     NoteTable,a2
  348. EffArpLoop:
  349.         move.w  (a2,d0.w),d2            ; d2 = new period
  350.         cmp.w   (a2)+,d1                ; (a2) == normal period
  351.         bne.s   EffArpLoop
  352. EffArpFound:
  353.         move.w  d2,AUDxPER(a1)
  354.         rts
  355.  
  356. EffPitchUp:
  357.         moveq   #0,d0
  358.         move.b  ad_Info(a0),d0          ; d0 = effect value
  359.         sub.w   d0,ad_PitchPer(a0)
  360.         cmp.w   #SI5,ad_PitchPer(a0)    ; less than lowest period ?
  361.         bpl.s   EffPitchOK
  362.         move.w  #SI5,ad_PitchPer(a0)
  363.         bra.s   EffPitchOK
  364. EffPitchDown:
  365.         moveq   #0,d0
  366.         move.b  ad_Info(a0),d0
  367.         add.w   d0,ad_PitchPer(a0)
  368.         cmp.w   #DO2,ad_PitchPer(a0)    ; more than highest period ?
  369.         bmi.s   EffPitchOK
  370.         move.w  #DO2,ad_PitchPer(a0)
  371. EffPitchOK:
  372.         move.w  ad_PitchPer(a0),AUDxPER(a1)
  373.         rts
  374.  
  375. PlaySound:
  376.         lea     sng_Data(a6),a0
  377.         lea     sng_Seq(a6),a1
  378.         move.w  CurrentPos,d0
  379.         move.w  d0,NewPosJump
  380.         moveq   #0,d1
  381.         move.b  0(a1,d0.w),d1           ; d1 = block number
  382.         moveq   #10,d0
  383.         lsl.l   d0,d1
  384.         add.l   OffsetBlock,d1          ; d1 = offset into block data
  385.         clr.w   AudioDMA
  386.  
  387.         lea     AUD0LCH,a3
  388.         lea     ChannelData0,a4
  389.         moveq   #MAXTRACK-1,d7          ; 4 tracks
  390. PlayLoop:
  391.         bsr.s   PlayInstr
  392.         add.w   #SIZEOF_AUD,a3
  393.         add.l   #SIZEOF_ad,a4
  394.         dbra    d7,PlayLoop
  395.  
  396.         move.w  AudioDMA,d0             ; start audio DMA
  397.         or.w    #DMASET,d0
  398.         move.w  d0,DMACON
  399.  
  400.         move.b  CIABCRA,d1              ; wait loop
  401.         move.b  d1,d0
  402.         and.b   #%11000000,d0
  403.         or.b    #%00001000,d0
  404.         move.b  d0,CIABCRA
  405.         move.b  #$2f,CIABTALO
  406.         move.b  #1,CIABTAHI
  407. PlayDelay1:
  408.         btst.b  #0,CIABCRA
  409.         bne.s   PlayDelay1
  410.         move.b  d1,CIABCRA
  411.         move.b  #%00000001,CIABICR
  412.  
  413.         lea     ChannelData0,a0         ; set new value into audio registers
  414.         lea     AUD0LCH,a1
  415.         moveq   #MAXTRACK-1,d0
  416. SetNewValue:
  417.         move.l  ad_RepAdr(a0),(a1)
  418.         move.w  ad_RepLen(a0),AUDxLEN(a1)
  419.         add.l   #SIZEOF_ad,a0
  420.         add.w   #SIZEOF_AUD,a1
  421.         dbra    d0,SetNewValue
  422.         cmp.l   #BLOCKSIZE-NEXTLINE,OffsetBlock  ; end of block ?
  423.         beq.s   ChangePosition
  424.         add.l   #NEXTLINE,OffsetBlock   ; modif. offsetblock
  425.         tst.w   BreakStatus             ; jump or break ?
  426.         beq.s   PlaySoundEnd
  427.         clr.w   BreakStatus
  428. ChangePosition:
  429.         clr.l   OffsetBlock             ; offset block = 0
  430.         move.w  NewPosJump,CurrentPos
  431.         addq.w  #1,CurrentPos           ; new position
  432.         move.w  sng_Len(a6),d0
  433.         move.w  CurrentPos,d1
  434.         cmp.w   d0,d1                   ; end of song ?
  435.         bne.s   PlaySoundEnd
  436.         clr.w   CurrentPos              ; position = 0
  437. PlaySoundEnd:
  438.         rts
  439.  
  440. PlayInstr:
  441.         lea     sng_Instr0(a6),a2
  442.         move.l  (a0,d1.l),ad_SampPer(a4)
  443.         addq.l  #NEXTTRACK,d1
  444.         moveq   #0,d0
  445.         move.b  ad_SampPer(a4),d0
  446.         lsr.b   #3,d0                   ; d0 = instrument number
  447.         tst.b   d0                      ; d0 == 0 ?
  448.         beq.s   NoSampleChange
  449.  
  450.         lea     SampleAdrTable,a5
  451.         subq.b  #1,d0
  452.         move.l  d0,d3
  453.         lsl.w   #2,d0                   ; d0 = SampleAdrTable offset
  454.         mulu    #SIZEOF_insdt,d3
  455.         add.l   #instr_Start,d3
  456.         add.l   d3,a2                   ; a2 -> Start InstrData
  457.         move.l  (a5,d0.w),d4
  458.         add.l   (a2)+,d4                ; Start
  459.         move.l  d4,ad_SmpAdr(a4)
  460.         beq.s   NoSampleChange
  461.         move.w  (a2)+,ad_SmpLen(a4)     ; Len
  462.         move.l  (a2)+,d5                ; RStart
  463.         move.w  (a2)+,d2                ; RLen
  464.         bne.s   SetRepeat
  465.         moveq   #1,d2
  466.         moveq   #0,d5
  467. SetRepeat:
  468.         move.w  d2,ad_RepLen(a4)
  469.         add.l   ad_SmpAdr(a4),d5
  470.         move.l  d5,ad_RepAdr(a4)
  471.         move.w  (a2),ad_Volume(a4)      ; Volume
  472. NoSampleChange:
  473.         move.w  ad_SampPer(a4),d6
  474.         and.w   #$7ff,d6                ; note == 0 ?
  475.         beq.s   TestEffects
  476.         move.w  d6,ad_ArpPer(a4)
  477.         move.w  ad_DMABit(a4),d0
  478.         move.w  d0,DMACON               ; cut DMA audio for this track
  479.  
  480.         move.b  CIABCRA,d2              ; wait loop
  481.         move.b  d2,d3
  482.         and.b   #%11000000,d3
  483.         or.b    #%00001000,d3
  484.         move.b  d3,CIABCRA
  485.         move.b  #$2f,CIABTALO
  486.         move.b  #1,CIABTAHI
  487. PlayDelay2:
  488.         btst.b  #0,CIABCRA
  489.         bne.s   PlayDelay2
  490.         move.b  d2,CIABCRA
  491.         move.b  #%00000001,CIABICR
  492.  
  493.         cmp.w   #STOP,d6                ; note == 'OFF' ?
  494.         bne.s   SetPlayRegs
  495.         clr.w   AUDxVOL(a3)             ; set audio volume to 0
  496.         or.w    d0,AudioDMA
  497.         rts
  498.  
  499. SetPlayRegs:
  500.         move.l  ad_SmpAdr(a4),(a3)      ; sample address == NULL ?
  501.         beq.s   TestEffects
  502.         move.w  ad_SmpLen(a4),AUDxLEN(a3)
  503.         move.w  d6,AUDxPER(a3)
  504.         or.w    d0,AudioDMA
  505.         move.w  d6,ad_PitchPer(a4)
  506. TestEffects:
  507.         move.b  ad_Effet(a4),d0         ; d0 = effect
  508.         bsr.s   EffVolume
  509.         tst.b   d0
  510.         beq.s   TestEffectsEnd
  511.         cmp.b   #FILTER,d0
  512.         beq.s   EffFilter
  513.         cmp.b   #MASTERVOL,d0
  514.         beq.s   EffMaster
  515.         cmp.b   #TEMPO,d0
  516.         beq.s   EffSpeed
  517.         cmp.b   #JUMP,d0
  518.         beq.s   EffJump
  519. TestEffectsEnd:
  520.         rts
  521.  
  522. EffVolume:                              ; modify volume
  523.         cmp.w   #VOLUME,d0
  524.         bne.s   UseInstrVol
  525.         moveq   #0,d2
  526.         move.b  ad_Info(a4),d2          ; d0 = new volume
  527.         bra.s   SetInstrVol
  528. UseInstrVol:
  529.         tst.w   d6
  530.         beq.s   EffVolumeEnd
  531.         move.w  ad_Volume(a4),d2
  532. SetInstrVol:
  533.         sub.w   MasterVolume,d2         ; new volume - master >= 0
  534.         bge.s   SetVolumeReg
  535.         moveq   #0,d2                   ; new volume = 0
  536. SetVolumeReg:
  537.         move.w  d2,AUDxVOL(a3)          ; new volume into audio reg
  538. EffVolumeEnd:
  539.         rts
  540.  
  541. EffMaster:                              ; modify master volume
  542.         moveq   #MAX_VOL,d2
  543.         move.b  ad_Info(a4),d0
  544.         sub.b   d0,d2
  545.         blt.s   EffMasterEnd
  546.         move.b  d2,MasterVolume+1
  547. EffMasterEnd:
  548.         rts
  549.  
  550. EffSpeed:                               ; modify tempo
  551.         move.b  ad_Info(a4),d0
  552.         beq.s   EffSpeedEnd
  553.         clr.w   PlayTimer
  554.         move.b  d0,sng_Tempo+1(a6)
  555. EffSpeedEnd:
  556.         rts
  557.  
  558. EffJump:                                ; jump or break
  559.         move.w  #1,BreakStatus
  560.         move.b  ad_Info(a4),d0
  561.         cmp.b   #BREAK,d0
  562.         beq.s   EffBreak
  563.         subq.b  #2,d0
  564.         ext.w   d0
  565.         move.w  d0,NewPosJump
  566.         rts
  567. EffBreak:
  568.         move.w  CurrentPos,NewPosJump
  569.         rts
  570.  
  571. EffFilter:                              ; filter on/off
  572.         move.b  ad_Info(a4),d0
  573.         bne.s   SetFilter
  574.         bset    #1,CIAAPRA
  575.         rts
  576. SetFilter:
  577.         bclr    #1,CIAAPRA
  578.         rts
  579.  
  580.         DSEG
  581.  
  582. CiabBase:       dc.l    0
  583. IsNTSC:         dc.w    0
  584.  
  585. CiabName:       dc.b    'ciab.resource',0
  586. TimerIntName:   dc.b    'DSS Tracker Player',0
  587.                 cnop    0,2
  588.  
  589. TimerInt:
  590.         dc.l  0                 ; Interrupt.is_Node.ln_Succ
  591.         dc.l  0                 ; Interrupt.is_Node.ln_Pred
  592.         dc.b  2                 ; Interrupt.is_Node.ln_Type = NT_INTERRUPT
  593.         dc.b  -10               ; Interrupt.is_Node.ln_Pri
  594.         dc.l  TimerIntName      ; Interrupt.is_Node.ln_Name
  595.         dc.l  0                 ; Interrupt.is_Data
  596.         dc.l  TimerIntRoutine   ; Interrupt.is_Code
  597.  
  598.  
  599. PlayOn:         dc.w    0
  600. PlayTimer:      dc.w    0
  601. CurrentPos:     dc.w    0
  602. OffsetBlock:    dc.l    0
  603. AudioDMA:       dc.w    0
  604. MasterVolume:   dc.w    0
  605. BreakStatus:    dc.w    0
  606. NewPosJump:     dc.w    0
  607.  
  608. ChannelData0:
  609.         dc.w    0               ; Period                0
  610.         dc.w    0               ; Sample+Info           2
  611.         dc.w    0               ; Volume                4
  612.         dc.l    0               ; Sample address        6
  613.         dc.w    0               ; Sample length        10
  614.         dc.l    0               ; Repeat address       12
  615.         dc.w    0               ; Repeat length        16
  616.         dc.w    0               ; Shazam period        18
  617.         dc.w    1               ; DMA bit              20
  618.         dc.w    0               ; Pitch  period        22
  619. ChannelData1:
  620.         ds.w    10
  621.         dc.w    2
  622.         dc.w    0
  623. ChannelData2:
  624.         ds.w    10
  625.         dc.w    4
  626.         dc.w    0
  627. ChannelData3:
  628.         ds.w    10
  629.         dc.w    8
  630.         dc.w    0
  631.  
  632.         dc.w    1712
  633. NoteTable:
  634.         dc.w    1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960,906
  635.         dc.w    856,808,762,720,678,640,604,570,538,508,480,453
  636.         dc.w    428,404,381,360,339,320,302,285,269,254,240,226
  637.         dc.w    214,202,190,180,170,160,151,143,135,127,120,113
  638.         dc.w    113,113,113,113,113,113,113,113,113,113,113,113
  639.         dc.w    113,113,113,113,113,113,113,113,113,113,113,113
  640.         dc.w    113,113,113,113,113,113
  641.  
  642. SampleAdrTable: ds.l    31
  643.  
  644. TimerTable:     dc.w    14187,14318
  645.  
  646. SongPointer:    dc.l    0               ; address of Module in CHIP memory
  647.  
  648.